<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        /*function Person() {
        }
        Person.prototype.name = '张三';
        Person.prototype.age = 19;
        Person.prototype.sex = '男';
        Person.prototype.say = function () {
            alert('我的名字是'+this.name+','+'今年'+this.age+'岁'+','+'性别'+this.sex);
        }
        var p1 = new Person();
        p1.name = '李四';   //优先查找实例 再找原型
        p1.say();*/
        function Person() {
        }
        Person.prototype.func = function () {
            console.log(11111111111111);
        }
        var p1 = new Person();
        Person.prototype = {
            func: function () {
                console.log(22222222222222);
            }
        }
        var p2 = new Person();
        p1.func();
        p2.func();
    </script>
</head>
<body>

</body>
</html>